using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Collections.ObjectModel;
using Evolution.Engine.Interfaces;

namespace Evolution.Engine.Managers
{
    public class ShaderManager : Singleton<ShaderManager>, ILoadable
    {
        private Dictionary<string, Shader> _Shaders = new Dictionary<string, Shader>();

        public ShaderManager()
        {
            Shader BasicEffect = new Shader("BasicEffect");
            _Shaders.Add("BasicEffect", BasicEffect);
        }

        internal Shader GetShader(string Asset)
        {
            return _Shaders[Asset] as Shader;
        }

        public void Add(Shader shader, string shadername)
        {
            if (!_Shaders.ContainsKey(shadername))
                _Shaders.Add(shadername, shader);
        }

        #region ILoadable Members

        public void LoadContent()
        {
            foreach (Shader shader in _Shaders.Values)
                shader.Load();
        }

        #endregion
    }
}
